#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include "stack.h"

int main(void)
{
    stack_t *t = stack_create(sizeof(int));

    assert(t != NULL);

    for (int i = 0; i < 20; i++)
    {
        int data = i;
        printf("data :%d push stack!\n", data);
        int ret = stack_push(t, &data);
        assert(ret == 0);
    }

    int data = 0;
    while (stack_pop(t, &data) == 0)
    {
        printf("data:%d\n", data);
    }
    printf("\n");
    stack_free(t);
    for (int i = 0; i < 20; i++)
    {
        int ret = stack_push(t, &i);
        // printf("ret :%d\n", ret);
        assert(ret == 0);
    }

    return 0;
}